<template>
	<view class="boxs">
		<view class="top">
			<view class="houseclass" v-for="(item,index) in arr" :key="index" @click="top(index,item.text)"
				:class="currentindex===index?'specil':''">
				{{item.text}}
			</view>
		</view>
		<view class="hr"></view>

		<!-- 二手房 -->
		<view class="secondhand" v-if="bool">
			<view class="box">
				<!-- 所在小区 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">所在小区</text>
					</view>
					<view class="hrs" @click="housename">
						<text class="plotbname">{{data1.housenames || data1.community_name}}</text>
						<image src="https://fangguaner.wm76.mtnet.ren/static/applet/right.png" mode="" class="right">
						</image>
					</view>
				</view>
				<!-- 房屋名称 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">房屋名称</text>
					</view>
					<view class="hrs">
						<input type="text" :value="showssa=='审核未通过'?data1.name:''" placeholder="如: xx小区 近地铁 中楼层 满五套三"
							@input="names" />
					</view>
				</view>

				<!-- 房源价格 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">房源总价</text>
					</view>
					<view class="hrss">
						<input type="digit" :value="data1.price" @input="houseprice" placeholder="如:200" />
					</view>
					<view class="price">
						万
					</view>
				</view>

				<!-- 建筑面积 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">建筑面积</text>
					</view>
					<view class="hrss">
						<input type="digit" :value="data1.building_area" @input="area" placeholder="如:100" />
					</view>
					<view class="price">
						㎡
					</view>
				</view>

				<view class="plotboxs">
					<view class="left">
						<text class="plot">房源价格</text>
					</view>
					<view class="hrss">
						<input type="digit" v-model="calculate" />
					</view>
					<view class="price">
						元/㎡
					</view>
				</view>

				<view class="plotboxs">
					<view class="left">
						<text class="plot">挂牌日期</text>
					</view>
					<view class="hrss">
						<input type="digit" :value="data1.listed" @input="hang" placeholder="如:2021年" />
					</view>
				</view>



				<view class="plotboxs">
					<view class="left">
						<text class="plot">建筑年份</text>
					</view>
					<view class="jianzhuyear">
						<picker mode="date" :value="date" :start="startDate" :end="endDate" @change="bindDateChange"
							fields="year">
							<view class="uni-input">{{data1.build_date}}</view>
						</picker>
					</view>
				</view>
				<!-- 套内面积-->
				<!-- <view class="plotboxs">
					<view class="left">
						<text class="plot">套内面积</text>
					</view>
					<view class="hrss">
						<input type="digit" :value="data1.cover_area" @input="areanei" />
					</view>
					<view class="price">
						㎡
					</view>
				</view> -->

				<!-- 房源编码-->
				<!-- <view class="plotboxs">
					<view class="left">
						<text class="plot">房源编码</text>
					</view>
					<view class="hrss">
						<input type="digit" :value="data1.serial_number" @input="serialnumber" />
					</view>
				</view> -->

				<!-- 房源编码-->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">房屋年份</text>
					</view>
					<view class="hrss">
						<input type="digit" :value="data1.house_year" @input="year" placeholder="如:80" />
					</view>
					<view class="price">
						年
					</view>
				</view>
				<!-- <view class="plotboxs">
					<view class="left">
						<text class="plot">户型结构</text>
					</view>
					<view class="hrss">
						<input type="text" :value="data1.house_structure" @input="huxing" />
					</view>
				</view> -->

				<view class="plotboxs">
					<view class="left">
						<text class="plot">梯户比</text>
					</view>
					<view class="hrss">
						<input type="text" :value="data1.ladder_house_scale" @input="tihubi" placeholder="如:1梯2户" />
					</view>
				</view>

				<!-- <view class="plotboxs">
					<view class="left">
						<text class="plot">权属</text>
					</view>
					<view class="hrss">
						<input type="text" @input="changquan" placeholder="如:商品房/经济适用房" :value="data1.property_ownership" />
					</view>
				</view> -->



				<!-- 楼层 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">楼&nbsp&nbsp&nbsp&nbsp层</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in the_floor" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data1.the_floor==item.name?'checked':''"
									:checked="data1.the_floor==item.name?true:false" @click="floorchoice(item)">
								</radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 所属楼层 -->
				<view class="plotboxs">
					<view class="department">
						所属楼层
					</view>
					<view class="transverse">
						<input type="number" :value="data1.floor" @input="floors" placeholder="如:20" />
					</view>
					<view class="department">
						总楼层
					</view>
					<view class="transverse">
						<input type="number" :value="data1.total_floors" @input="allfloor" placeholder="如:30" />
					</view>
				</view>

				<!-- 户型 -->
				<view class="plotboxs">
					<view class="department">
						户&nbsp&nbsp&nbsp&nbsp型
					</view>
					<view class="transverses" @click="housetype('show')">
						<view type="text" value="" class="style">{{list[textone[0]].label || data1.room}}</view>
						<view class="angle"></view>
					</view>室
					<view class="transverses" @click="housetype('show1')">
						<view type="text" value="" class="style">{{list1[texttwo[0]].label || data1.hall}}</view>
						<view class="angle"></view>
					</view>厅
					<view class="transverses" @click="housetype('show2')">
						<view type="text" value="" class="style">{{ list2[textthree[0]].label || data1.rest_room}}
						</view>
						<view class="angle"></view>
					</view>卫
				</view>

				<u-select v-model="show" mode="single-column" :list="list" @confirm="confirm" :default-value="textone">
				</u-select>
				<u-select v-model="show1" mode="single-column" :list="list1" @confirm="confirm1"
					:default-value="texttwo"></u-select>
				<u-select v-model="show2" mode="single-column" :list="list2" @confirm="confirm2"
					:default-value="textthree"></u-select>


				<!-- 房型 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">房&nbsp&nbsp&nbsp&nbsp型</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in house_type" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data1.house_type==item.name?'checked':''"
									:checked="data1.house_type==item.name?true:false" @click="housetypess(item,index)">
								</radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 朝向 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">朝&nbsp&nbsp&nbsp&nbsp向</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in orientation" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data1.orientation==item.name?'checked':''"
									:checked="data1.orientation==item.name?true:false" @click="orientationchao(item)">
								</radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>


				<!-- 用途 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">用&nbsp&nbsp&nbsp&nbsp途</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in purpose" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data1.purpose==item.name?'checked':''"
									:checked="data1.purpose==item.name?true:false"
									@click="selectBase('purpose', 'name', item)"></radio>
								<text>{{item.text || item.name}}</text>
							</view>
						</view>
					</view>
				</view>

				<view class="plotbox">
					<view class="left">
						<text class="plot">建筑类型</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in build_type" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data1.build_type==item.name?'checked':''"
									:checked="data1.build_type==item.name?true:false"
									@click="selectBase('build_type', 'name', item)"></radio>
								<text>{{item.text || item.name}}</text>
							</view>
						</view>
					</view>
				</view>

				<view class="plotbox">
					<view class="left">
						<text class="plot">权&nbsp&nbsp&nbsp&nbsp属</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in ownerships" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data1.ownerships==item.name?'checked':''"
									:checked="data1.ownerships==item.name?true:false"
									@click="selectBase('ownerships', 'name', item)"></radio>
								<text>{{item.text || item.name}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 是否电梯 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">是否电梯</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in elevator" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data1.elevator==item.name?'checked':''"
									:checked="data1.elevator==item.name?true:false" @click="televator(item)">
								</radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>



				<view class="plotbox">
					<view class="left">
						<text class="plot">房源特色</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in house_features" :key="index">
							<view class="cu-form-group">
								<radio class='red radio'
									:class="data1.house_features.indexOf(item.name) > -1 ?'checked':''"
									:checked="data1.house_features.indexOf(item.name) > -1?true:false"
									@click="selectBase('house_features', 'name', item,true)"></radio>
								<text>{{item.text || item.name}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 封面上传 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">封面图片</text>
					</view>
					<UpLoadimg @successImg="successImg1" :imgList="data1.imgList" @deleteImg="deleteImg1"></UpLoadimg>
				</view>



				<!-- 详情图片 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">详情图片</text>
					</view>
					<UpLoadimg @successImg="successImg2" :imgList="data1.imgList2" @deleteImg="deleteImg2"
						:imgMaxNum="10">
					</UpLoadimg>
				</view>



				<!-- 保安管理 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">保安管理</text>
					</view>
					<view class="hrs" @click="policebtn1">
						<text class="plotbname">{{data1.policename1 || data1.guard_name}}</text>
						<image src="https://fangguaner.wm76.mtnet.ren/static/applet/right.png" mode="" class="right">
						</image>
					</view>
				</view>

				<!-- 标签管理 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">标签管理</text>
					</view>
					<view class="hrs">
						<BaseLabel ref="baseLabel" :arr="data1.biaoqian" :arr1="data1.selectbiaoqian"
							@selectItem="selectItem" @shuruItem="shuruItem"></BaseLabel>
					</view>
				</view>


				<view class="plotbox">
					<view class="left">
						<text class="plot">是否显示业主信息</text>
					</view>
					<view class="cekname" style="margin-left: 20rpx;">
						<switch @change="switch1Change" />
					</view>
				</view>





				<view class="plotboxs">
					<view class="left">
						<text class="plot">业主姓名</text>
					</view>
					<view class="hrs">
						<input type="text" :value="data1.contact" @input="contactname" />
					</view>
				</view>

				<view class="plotboxs">
					<view class="left">
						<text class="plot">业主电话</text>
					</view>
					<view class="hrs">
						<input type="number" :value="data1.contact_number" @input="telephonenum" />
					</view>
				</view>
				<view class="plotboxs">
					<view class="left">
						<text class="plot">备&nbsp&nbsp&nbsp&nbsp注</text>
					</view>
					<textarea :value="data1.remark" placeholder="备注" @input="describe" />
				</view>

				<view class="plotboxs">
					<view class="left">
						<text class="plot">简介</text>
					</view>
					<textarea :value="data1.description" placeholder="简介" @input="descriptions" />
				</view>
				<view class="plotboxs">
					<view class="left">
						<text class="plot">看房说明</text>
					</view>
					<textarea :value="data1.see_house" placeholder="看房说明" @input="see_houses" />
				</view>
			</view>
		</view>



		<!-- 出租房 -->
		<!-- 出租房 -->
		<view class="rent" v-else>
			<view class="box">
				<!-- 所在小区 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">所在小区</text>
					</view>
					<view class="hrs" @click="housename2">
						<text class="plotbname">{{data2.housenames2 || data2.community_name}}</text>
						<image src="https://fangguaner.wm76.mtnet.ren/static/applet/right.png" mode="" class="right">
						</image>
					</view>
				</view>

				<!-- 租房名称 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">租房名称</text>
					</view>
					<view class="hrs">
						<input type="text" :value="showssa=='审核未通过'?data2.name:''" placeholder="如:xx小区 近地铁 中楼层 满五套三"
							@input="rentname" />
					</view>
				</view>


				<!-- 租房名称 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">每月租金</text>
					</view>
					<view class="hrss">
						<input type="digit" :value="data2.price" placeholder="如:2000" @input="rentprice" />
					</view>
					<view class="price">
						元/月
					</view>
				</view>


				<!-- 建筑面积 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">建筑面积</text>
					</view>
					<view class="hrss">
						<input type="digit" :value="data2.building_area" placeholder="如:100" @input="areas" />
					</view>
					<view class="price">
						㎡
					</view>
				</view>


				<!-- 楼层 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">楼&nbsp&nbsp&nbsp&nbsp层</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in the_floor" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.the_floor==item.name?'checked':''"
									:checked="data2.the_floor==item.name?true:false" @click="selcfour(item)"></radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>


				<view class="plotboxs">
					<view class="department">
						所属楼层
					</view>
					<view class="transverse">
						<input type="number" :value="data2.floor" placeholder="如:20" @input="floorss" />
					</view>
					<view class="department">
						总楼层
					</view>
					<view class="transverse">
						<input type="number" :value="data2.total_floors" placeholder="如:30" @input="allfloos" />
					</view>
				</view>


				<!-- 出租方式 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">出租方式</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in rent_type" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.rent_type==item.name?'checked':''"
									:checked="data2.rent_type==item.name?true:false" @click="selcone(item)"></radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>


				<!-- 房屋租期 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">房屋租期</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in rent_term" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.rent_term==item.name?'checked':''"
									:checked="data2.rent_term==item.name?true:false" @click="selctwo(item)"></radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>


				<!-- 付款方式 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">付款方式</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in payType" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.pay_type==item.id?'checked':''"
									:checked="data2.pay_type==item.id?true:false"
									@click="selectBase1('pay_type', 'id', item)"></radio>
								<text>{{item.text}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 是否有燃气 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">是否有燃气</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in have_gas" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.have_gas==item.id?'checked':''"
									:checked="data2.have_gas==item.id?true:false"
									@click="selectBase1('have_gas', 'id', item)"></radio>
								<text>{{item.text}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 是否有车位 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">是否有车位</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in have_parking" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.have_parking==item.id?'checked':''"
									:checked="data2.have_parking==item.id?true:false"
									@click="selectBase1('have_parking', 'id', item)"></radio>
								<text>{{item.text}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 朝向 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">朝向</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in orientation" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.orientation==item.name?'checked':''"
									:checked="data2.orientation==item.name?true:false"
									@click="selectBase1('orientation', 'name', item)"></radio>
								<text>{{item.text || item.name}}</text>
							</view>
						</view>
					</view>
				</view>


				<!-- 房源亮点 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">房源亮点</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in house_bright" :key="index">
							<view class="cu-form-group">
								<radio class='red radio'
									:class="data2.house_bright.indexOf(item.name) > -1 ?'checked':''"
									:checked="data2.house_bright.indexOf(item.name) > -1?true:false"
									@click="selectBase1('house_bright', 'name', item, true)"></radio>
								<text>{{item.text || item.name}}</text>
							</view>
						</view>
					</view>
				</view>


				<!-- 配套设施 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">配套设施</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in facilities" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.facilities.indexOf(item.id) > -1 ?'checked':''"
									:checked="data2.facilities.indexOf(item.id) > -1?true:false"
									@click="selectBase1('facilities', 'id', item, true)"></radio>
								<text>{{item.text || item.name}}</text>
							</view>
						</view>
					</view>
				</view>


				<!-- 是否电梯 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">是否电梯</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in elevator" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.elevator==item.name?'checked':''"
									:checked="data2.elevator==item.name?true:false" @click="rentelevator(item)">
								</radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 是否权属核验 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">是否权属核验</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in ownership" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.ownership==item.name?'checked':''"
									:checked="data2.ownership==item.name?true:false" @click="selcfive(item)"></radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- 装修标准 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">装修标准</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in decorate" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.decorate==item.name?'checked':''"
									:checked="data2.decorate==item.name?true:false" @click="selcsix(item)"></radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>

				<!-- <view class="plotboxs">
					<view class="left">
						<text class="plot">房源编码</text>
					</view>
					<view class="hrs">
						<input type="number" v-model="data2.serial_number" />
					</view>
				</view> -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">供水</text>
					</view>
					<view class="hrs">
						<input type="number" v-model="data2.water_supply" placeholder="如:(有供水/无供水)" />
					</view>
				</view>
				<view class="plotboxs">
					<view class="left">
						<text class="plot">供暖</text>
					</view>
					<view class="hrs">
						<input type="number" v-model="data2.heating_supply" placeholder="如:(有供暖/无供暖)" />
					</view>
				</view>
				<view class="plotboxs">
					<view class="left">
						<text class="plot">供电</text>
					</view>
					<view class="hrs">
						<input type="number" v-model="data2.power_supply" placeholder="如:(有供电/无供电)" />
					</view>
				</view>


				<!-- 户型 -->
				<view class="plotboxs">
					<view class="department">
						户&nbsp&nbsp&nbsp&nbsp型
					</view>
					<view class="transverses" @click="housetype('show3')">
						<view type="text" value="" class="style">{{list3[textfrou[0]].label || data2.room}}</view>
						<view class="angle"></view>
					</view>室
					<view class="transverses" @click="housetype('show4')">
						<view type="text" value="" class="style">{{list4[textfive[0]].label || data2.hall}}</view>
						<view class="angle"></view>
					</view>厅
					<view class="transverses" @click="housetype('show5')">
						<view type="text" value="" class="style" style="text-align: center;">
							{{list5[textsix1[0]].label || data2.rest_room}}
						</view>
						<view class="angle"></view>
					</view>卫
				</view>

				<u-select v-model="show3" mode="single-column" :list="list3" @confirm="confirm3"
					:default-value="textfrou"></u-select>
				<u-select v-model="show4" mode="single-column" :list="list4" @confirm="confirm4"
					:default-value="textfive"></u-select>
				<u-select v-model="show5" mode="single-column" :list="list5" @confirm="confirm5"
					:default-value="textsix1"></u-select>




				<!-- 房型 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">房&nbsp&nbsp&nbsp&nbsp型</text>
					</view>
					<view class="cekname" style="display: flex;">
						<view class="show" v-for="(item,index) in house_type" :key="index">
							<view class="cu-form-group">
								<radio class='red radio' :class="data2.house_type==item.name?'checked':''"
									:checked="data2.house_type==item.name?true:false" @click="rentselcthree(item)">
								</radio>
								<text>{{item.name}}</text>
							</view>
						</view>
					</view>
				</view>


				<!-- 房屋封面 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">房屋封面</text>
					</view>
					<UpLoadimg @successImg="successImg3" :imgList="data2.imgList3" @deleteImg="deleteImg3"></UpLoadimg>
				</view>

				<!-- 详情图片 -->
				<view class="plotboxs">
					<view class="left">
						<text class="plot">详情图片</text>
					</view>
					<UpLoadimg @successImg="successImg4" :imgList="data2.imgList4" @deleteImg="deleteImg4"
						:imgMaxNum="10">
					</UpLoadimg>
				</view>


				<!-- 保安管理 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">保安管理</text>
					</view>
					<view class="hrs" @click="police">
						<text class="plotbname">{{data2.policename2 || data2.guard_name}}</text>
						<image src="https://fangguaner.wm76.mtnet.ren/static/applet/right.png" mode="" class="right">
						</image>
					</view>
				</view>



				<!-- 标签管理 -->
				<view class="plotbox">
					<view class="left">
						<text class="plot">标签管理</text>
					</view>
					<view class="hrs">
						<BaseLabel ref="baseLabel" :arr="data2.biaoqian" :arr1="data2.selectbiaoqian1"
							@selectItem="selectItem1" @shuruItem="shuruItem1"></BaseLabel>
					</view>
				</view>



				<view class="plotbox">
					<view class="left">
						<text class="plot">是否显示业主信息</text>
					</view>
					<view class="cekname" style="margin-left: 20rpx;">
						<switch @change="switch2Change" />
					</view>
				</view>


				<view class="plotboxs">
					<view class="left">
						<text class="plot">业主姓名</text>
					</view>
					<view class="hrs">
						<input type="text" :value="data2.contact" @input="rentcontact" />
					</view>
				</view>

				<view class="plotboxs">
					<view class="left">
						<text class="plot">业主电话</text>
					</view>
					<view class="hrs">
						<input type="number" :value="data2.contact_number" @input="rentnum" />
					</view>
				</view>

				<view class="plotboxs">
					<view class="left">
						<text class="plot">备&nbsp&nbsp&nbsp&nbsp注</text>
					</view>
					<textarea :value="data2.remark" placeholder="备注" @input="rentdescribe" />
				</view>






				<view class="plotboxs">
					<view class="left">
						<text class="plot">看房说明</text>
					</view>
					<textarea :value="data2.see_house" placeholder="看房说明" @input="rentdessee_house" />
				</view>



			</view>
		</view>
		<view class="basebtn">
			<view class="uploads" @click="housesave">
				保存
			</view>
			<view class="upload" @click="upload">
				发布
			</view>
		</view>
	</view>
</template>

<script>
	import BaseLabel from "../../components/BaseLabel/BaseLabel.vue"
	import {
		getselect,
		uploadfiles,
		getlabel,
		getfinishhouse,
		getPtSS,
		gethousefinish
	} from "../../api/api/index.js"
	import {
		baseUrl
	} from "../../api/request.js"
	import {
		upUrl
	} from "../../api/request.js"
	import UpLoadimg from "../../components/UpLoadimg/index.vue"
	export default {

		data() {
			const currentDate = this.getDate({
				format: false
			})
			return {
				date: currentDate,
				flag: false,
				data1: {
					see_house: "",
					house_structure: "",
					ladder_house_scale: "",
					ownerships: "",
					orientation: "",
					purpose: "",
					action: "add",
					type: 1,
					community_id: 0,
					name: "",
					image: "",
					banner: "",
					guard_id: 0,
					label: "",
					remark: "",
					price: "",
					floor: "",
					total_floors: "",
					contact: "",
					contact_number: "",
					guard_house_id: 0,
					house_type: "",
					room: "",
					hall: "",
					rest_room: "",
					unit_price: "",
					building_area: "",
					landlord: 0,
					the_floor: "",
					imgList: [],
					imgList2: [],
					selectbiaoqian: [],
					biaoqian: [],
					housenames: "",
					policename1: "",
					cover_area: "",
					serial_number: "",
					build_type: "",
					house_features: [],
					elevator: "",
					listed: "",
					build_date: currentDate
				},
				showssa: "",
				up: "",
				// 付款方式
				payType: [{
					text: "月付",
					id: 1
				}, {
					text: "季付",
					id: 2
				}, {
					text: "半年付",
					id: 3
				}, {
					text: "年付",
					id: 4
				}],
				// 是否有燃气
				have_gas: [{
					text: "是",
					id: 1
				}, {
					text: "否",
					id: 0
				}],
				// 是否有车位
				have_parking: [{
					text: "是",
					id: 1
				}, {
					text: "否",
					id: 0
				}],
				orientation: [], //朝向
				house_bright: [], //房源亮点
				facilities: [], //配套设置
				data2: {
					pay_type: 0, //--付款方式   1=月付   2=季付   3=半年付   4=年付
					orientation: '', //朝向
					see_house: "", //看房说明
					house_bright: [], //房源亮点
					serial_number: '', //房源编码
					facilities: [], //配套设施
					water_supply: '', //供水
					heating_supply: '', //供暖
					power_supply: '', //供电
					have_gas: 0, //是否有燃气
					have_parking: 0, //是否有车位
					action: "add",
					type: 2,
					community_id: 0,
					name: "",
					image: "",
					banner: "",
					guard_id: 0,
					label: "",
					remark: "",
					price: "",
					contact: "",
					contact_number: "",
					house_type: "",
					room: "",
					hall: "",
					rest_room: "",
					building_area: "",
					landlord: 0,
					rent_type: "",
					rent_term: "",
					elevator: "",
					the_floor: "",
					ownership: "",
					decorate: "",
					total_floors: "",
					floor: "",
					housenames2: "",
					policename2: "",
					biaoqian: [],
					imgList3: [],
					imgList4: [],
					selectbiaoqian1: [],
					id: ""
				},
				build_type: [],
				orientation: [],
				ownership: [],
				purpose: [],
				ownerships: [],

				// 二手房封面上传
				imgList: [],
				imgArr: "",

				// 判断二手房还是出租房
				type: "二手房",
				// 二手房封面
				action: upUrl,
				fileList: [],
				// 二手房详情图片
				action1: upUrl,
				fileList1: [],
				house_features: [],





				rentid: 0,

				// 房型
				house_type: [],
				// 是否显示业主信息
				showarr: [{
					text: "否",
					id: 0
				}, {
					text: "是",
					id: 1
				}],
				bool: true,
				arr: [{
					text: "二手房"
				}, {
					text: "租房"
				}],
				currentindex: 0,
				// 封面图片
				imgList: [],
				imgArr: "",
				// 详情图片
				imgLists: [],
				imgArrs: "",
				// 详情图片
				imgListone: [],
				imgArrone: "",
				imgListtwo: [],
				imgArrtwo: "",
				// 出租房出租方式
				rent_type: [],
				// 租房租期
				rent_term: [],
				// 是否电梯
				elevator: [],
				// 楼层
				the_floor: [],

				// 是否权属核验
				arr6: [{
					text: "否"
				}, {
					text: "是"
				}],
				// 装修标准
				decorate: [],

				// 下拉框
				show: false,
				show1: false,
				show2: false,
				show3: false,
				show4: false,
				show5: false,
				list: [{
						value: '1',
						label: '1'
					},
					{
						value: '2',
						label: '2'
					}, {
						value: '3',
						label: '3'
					},
					{
						value: '4',
						label: '4'
					}
				],
				list1: [{
						value: '1',
						label: '1'
					},
					{
						value: '2',
						label: '2'
					}, {
						value: '3',
						label: '3'
					},
					{
						value: '4',
						label: '4'
					}
				],
				list2: [{
						value: '1',
						label: '1'
					},
					{
						value: '2',
						label: '2'
					}, {
						value: '3',
						label: '3'
					},
					{
						value: '4',
						label: '4'
					}
				],

				list3: [{
						value: '1',
						label: '1'
					},
					{
						value: '2',
						label: '2'
					}, {
						value: '3',
						label: '3'
					},
					{
						value: '4',
						label: '4'
					}
				],
				list4: [{
						value: '1',
						label: '1'
					},
					{
						value: '2',
						label: '2'
					}, {
						value: '3',
						label: '3'
					},
					{
						value: '4',
						label: '4'
					}
				],
				list5: [{
						value: '1',
						label: '1'
					},
					{
						value: '2',
						label: '2'
					}, {
						value: '3',
						label: '3'
					},
					{
						value: '4',
						label: '4'
					}
				],
				textone: [],
				texttwo: [],
				textthree: [],
				textfrou: [],
				textfive: [],
				textsix1: [],

			}
		},
		components: {
			BaseLabel,
			UpLoadimg
		},
		methods: {
			
			bindDateChange: function(e) {
				this.data1.build_date = e.target.value+"年"
			},
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				// let month = date.getMonth() + 1;
				// let day = date.getDate();
			
				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
				// month = month > 9 ? month : '0' + month;
				// day = day > 9 ? day : '0' + day;
				// return `${year}-${month}-${day}`;
				return `${year}年`;
			},
			
			// 是否显示业主信息
			switch1Change(e) {
				if (e.detail.value) {
					this.data1.landlord = 1
				} else {
					this.data1.landlord = 0
				}
			},
			switch2Change(e) {
				if (e.detail.value) {
					this.data2.landlord = 1
				} else {
					this.data2.landlord = 0
				}
			},



			selectBase(name, id, item, isMush) {
				if (isMush) { //多选
					let index = this.data1[name].indexOf(item[id])
					if (index > -1) {
						this.data1[name].splice(index, 1)
					} else {
						this.data1[name].push(item[id])
					}
				} else {
					if (this.data1[name] != item[id]) {
						this.data1[name] = item[id]
					} else {
						this.data1[name] = ""
					}
				}
			},
			//所有选中的点击
			selectBase1(name, id, item, isMush) {
				if (isMush) { //多选
					let index = this.data2[name].indexOf(item[id])
					if (index > -1) {
						this.data2[name].splice(index, 1)
					} else {
						this.data2[name].push(item[id])
					}
				} else {
					if (this.data2[name] != item[id]) {
						this.data2[name] = item[id]
					} else {
						this.data2[name] = ""
					}

				}
			},
			rentdessee_house(e) {
				this.data2.see_house = e.detail.value
			},

			// 二手房输入框
			names(e) {
				this.data1.name = e.detail.value
			},
			houseprice(e) {
				this.data1.price = e.detail.value
			},
			area(e) {
				this.data1.building_area = e.detail.value
			},
			areanei(e) {
				this.data1.cover_area = e.detail.value
			},
			builddate(e) {
				this.data1.build_date = e.detail.value
			},
			serialnumber(e) {
				this.data1.serial_number = e.detail.value
			},
			year(e) {
				this.data1.house_year = e.detail.value
			},
			huxing(e) {
				this.data1.house_structure = e.detail.value
			},
			tihubi(e) {
				this.data1.ladder_house_scale = e.detail.value
			},
			floors(e) {
				this.data1.floor = e.detail.value
			},
			changquan(e) {
				this.data1.property_ownership = e.detail.value
			},
			allfloor(e) {
				this.data1.total_floors = e.detail.value
			},
			hang(e) {
				this.data1.listed = e.detail.value
			},
			televator(item) {
				if (this.data1.elevator != item.name) {
					this.data1.elevator = item.name
				} else {
					this.data1.elevator = ""
				}
			},
			housetypess(item) {
				if (this.data1.house_type != item.name) {
					this.data1.house_type = item.name
				} else {
					this.data1.house_type = ""
				}
			},
			contactname(e) {
				this.data1.contact = e.detail.value
			},
			telephonenum(e) {
				this.data1.contact_number = e.detail.value
			},
			//二手房封面上传
			successImg1(data) {
				this.data1.imgList.push(data)
			},
			deleteImg1(index) {
				this.data1.imgList.splice(index, 1)
			},
			//二手详情图片
			successImg2(data) {
				this.data1.imgList2.push(data)
			},

			deleteImg2(index) {
				this.data1.imgList2.splice(index, 1)
			},
			selectItem(item) {
				const index = this.data1.selectbiaoqian.indexOf(item.id);
				if (index > -1) {
					this.data1.selectbiaoqian.splice(index, 1)
				} else {
					this.data1.selectbiaoqian.push(item.id)
				}
				let a = []
				this.data1.biaoqian.forEach(v => {
					if (this.data1.selectbiaoqian.indexOf(v.id) !== -1) {
						a.push(v.text)
					}
				})
				this.data1.label = a.join("|")

			},
			shuruItem(e) {
				if (e.id != "") {
					this.data1.biaoqian.push(e)
					this.$refs.baseLabel.zhi = '自定义'
				} else {
					return
				}
			},
			confirm(e) {
				this.list.forEach((item, index) => {
					if (item.value == e[0].value) {
						this.data1.room = e[0].label
						this.textone = [index]
					}
				})
			},
			confirm1(e) {
				this.list.forEach((item, index) => {
					if (item.value == e[0].value) {
						this.data1.hall = e[0].label
						this.texttwo = [index]
					}
				})
			},
			confirm2(e) {
				this.list.forEach((item, index) => {
					if (item.value == e[0].value) {
						this.data1.rest_room = e[0].label
						this.textthree = [index]
					}
				})
			},
			// 二手房楼层选择
			floorchoice(item) {
				if (this.data1.the_floor != item.name) {
					this.data1.the_floor = item.name
				} else {
					this.data1.the_floor = ""
				}
			},
			// 朝向
			orientationchao(item) {

				if (this.data1.orientation != item.name) {
					this.data1.orientation = item.name
				} else {
					this.data1.orientation = ""
				}

			},









			// 出租房输入框
			rentname(e) {
				this.data2.name = e.detail.value
			},
			rentprice(e) {
				this.data2.price = e.detail.value
			},
			areas(e) {
				this.data2.building_area = e.detail.value
			},
			selcfour: function(item) {
				if (this.data2.the_floor != item.name) {
					this.data2.the_floor = item.name
				} else {
					this.data2.the_floor = ""
				}

			},
			floorss(e) {
				this.data2.floor = e.detail.value
			},
			allfloos(e) {
				this.data2.total_floors = e.detail.value
			},
			// 出租方式
			selcone: function(item) {
				if (this.data2.rent_type != item.name) {
					this.data2.rent_type = item.name
				} else {
					this.data2.rent_type = ""
				}
			},
			selctwo: function(item) {
				if (this.data2.rent_term != item.name) {
					this.data2.rent_term = item.name
				} else {
					this.data2.rent_term = ""
				}
			},
			rentelevator(item) {
				if (this.data2.elevator != item.name) {
					this.data2.elevator = item.name
				} else {
					this.data2.elevator = ""
				}

			},
			selcfive: function(item) {
				if (this.data2.ownership != item.name) {
					this.data2.ownership = item.name
				} else {
					this.data2.ownership = ""
				}

			},
			selcsix: function(item) {
				if (this.data2.decorate != item.name) {
					this.data2.decorate = item.name
				} else {
					this.data2.decorate = ""
				}

			},
			rentselcthree(item) {
				if (this.data2.house_type != item.name) {
					this.data2.house_type = item.name
				} else {
					this.data2.house_type = item.name
				}

			},
			// 出租房是否显示业主信息
			showss(item) {
				if (this.data2.landlord != item.id) {
					this.data2.landlord = item.id
				} else {
					this.data2.landlord = ""
				}
			},
			confirm3(e) {
				this.list.forEach((item, index) => {
					if (item.value == e[0].value) {
						this.data2.room = e[0].label
						this.textfrou = [index]
					}
				})
			},
			confirm4(e) {
				this.list.forEach((item, index) => {
					if (item.value == e[0].value) {
						this.data2.hall = e[0].label
						this.textfive = [index]
					}
				})
			},

			confirm5(e) {
				this.list.forEach((item, index) => {
					if (item.value == e[0].value) {
						this.data2.rest_room = e[0].label
						this.textsix1 = [index]
					}
				})
			},
			rentcontact(e) {
				this.data2.contact = e.detail.value
			},
			rentnum(e) {
				this.data2.contact_number = e.detail.value
			},
			rentdescribe(e) {
				this.data2.remark = e.detail.value
			},
			successImg3(data) {
				this.data2.imgList3.push(data)
			},
			deleteImg3(index) {
				this.data2.imgList3.splice(index, 1)
			},
			successImg4(data) {
				this.data2.imgList4.push(data)
			},

			deleteImg4(index) {
				this.data2.imgList4.splice(index, 1)
			},

			// 出租房选择标签
			selectItem1(item) {
				const index = this.data2.selectbiaoqian1.indexOf(item.id);
				if (index > -1) {
					this.data2.selectbiaoqian1.splice(index, 1)
				} else {
					this.data2.selectbiaoqian1.push(item.id)
				}
				let a = []
				this.data2.biaoqian.forEach(v => {
					if (this.data2.selectbiaoqian1.indexOf(v.id) !== -1) {
						a.push(v.text)
					}
				})
				this.data2.label = a.join("|")

			},
			shuruItem1(e) {
				if (e.id != "") {
					this.data2.biaoqian.push(e)
					this.$refs.baseLabel.zhi = '自定义'
				} else {
					return
				}
			},
			describe(e) {
				this.data1.remark = e.detail.value
			},
			descriptions(e) {
				this.data1.description = e.detail.value
			},
			see_houses(e) {
				this.data1.see_house = e.detail.value
			},

			rentdessee_house(e) {
				this.data2.see_house = e.detail.value
			},


			top: function(index, item) {
				this.type = item
				this.currentindex = index

				if (this.type == "二手房") {
					this.bool = true
					getlabel({
						type: 1
					}).then(res => {
						this.data1.biaoqian = res.data.map(v => {
							v.text = v.name
							return v
						})
					})
				} else if (this.type = '租房') {
					this.bool = false
					getlabel({
						type: 2
					}).then(res => {
						this.data2.biaoqian = res.data.map(v => {
							v.text = v.name
							return v
						})
					})
				}
			},


			// 二手房是否显示业主信息
			shouw(item) {
				this.data1.landlord = item.id
			},




			// 二手房
			housename() {
				this.jumpLink({
					link: "/pages/department/index",
					query: {
						'type': "二手房"
					}
				})
			},
			housename2() {
				this.jumpLink({
					link: "/pages/department/index",
					query: {
						'type': "租房"
					}
				})
			},

			// 二手房户型
			housetype(name) {
				this.show = false
				this.show1 = false
				this.show2 = false
				this.show3 = false
				this.show4 = false
				this.show5 = false
				this[name] = true
			},







			// 二手房保安管理
			policebtn1() {
				this.jumpLink({
					link: "/pages/Securitymanagement/index",
					query: {
						'type': "二手房"
					}
				})
			},
			police() {
				this.jumpLink({
					link: "/pages/Securitymanagement/index",
					query: {
						'type': "租房"
					}
				})
			},


			// 上传房源发布
			upload() {
				this.$store.state.community_id = ""
				this.$store.state.guard_id = ""
				this.$store.state.name = ""
				this.$store.state.plicname = ""
				let data4 = {}
				if (this.type == "二手房") {
					let a = []
					if (this.data1.imgList.length != 0 && this.data1.imgList2.length != 0) {
						for (let i = 0; i < this.data1.imgList2.length; i++) {
							a.push(this.data1.imgList2[i].url)
						}
						data4 = {
							action: "add", //方式
							type: 1,
							community_id: this.data1.community_id,
							name: this.data1.name,
							price: this.data1.price,
							building_area: this.data1.building_area,
							elevator: this.data1.elevator,
							the_floor: this.data1.the_floor,
							image: this.data1.imgList[0].url, //封面一张
							banner: a.join("|"), //banner图
							label: this.data1.label,
							remark: this.data1.remark,
							floor: this.data1.floor,
							total_floors: this.data1.total_floors,
							landlord: this.data1.landlord,
							contact: this.data1.contact,
							contact_number: this.data1.contact_number,
							house_type: this.data1.house_type,
							room: this.data1.room,
							hall: this.data1.hall,
							rest_room: this.data1.rest_room,
							orientation: this.data1.orientation,
							see_house: this.data1.see_house,
							description: this.data1.description,
							status: 1, //0=保存    1=发布
							guard_id: this.data1.guard_id,
							id: this.data1.id,
							listed: this.data1.listed,
							// house_structure: this.data1.house_structure,
							ladder_house_scale: this.data1.ladder_house_scale,
							house_features: this.data1.house_features,
							build_type: this.data1.build_type,
							purpose: this.data1.purpose,
							unit_price: this.calculate,
							build_date: this.data1.build_date,
							ownerships: this.data1.ownerships,
							house_year: this.data1.house_year
						}
						console.log(data4)
						debugger
						getfinishhouse(data4).then(res => {
							// debugger
							uni.showToast({
								title: res.message,
								icon: "none",
								duration: 1500,
								mask: true
							})
							setTimeout(function() {
								uni.navigateBack({})
							}, 1500)
						})
					} else {
						uni.showToast({
							title: "请将信息填写完整",
							icon: "none",
							duration: 1500
						})
					}
				} else if (this.type == "租房") {
					let a = []
					if (this.data2.imgList3.length != 0 && this.data2.imgList4.length != 0) {
						for (let i = 0; i < this.data2.imgList4.length; i++) {
							a.push(this.data2.imgList4[i].url)
						}
						data4 = {
							action: "add", //方式
							type: 2,
							community_id: this.data2.community_id,
							name: this.data2.name,
							price: this.data2.price,
							building_area: this.data2.building_area,
							elevator: this.data2.elevator,
							the_floor: this.data2.the_floor,
							image: this.data2.imgList3[0].url, //封面一张
							banner: a.join("|"), //banner图
							serial_number: this.data2.serial_number, //房源编码
							label: this.data2.label,
							remark: this.data2.remark,
							floor: this.data2.floor,
							total_floors: this.data2.total_floors,
							landlord: this.data2.landlord,
							contact: this.data2.contact,
							contact_number: this.data2.contact_number,
							house_type: this.data2.house_type,
							room: this.data2.room,
							hall: this.data2.hall,
							rest_room: this.data2.rest_room,
							orientation: this.data2.orientation,
							see_house: this.data2.see_house,
							status: 1, //0=保存    1=发布
							guard_id: this.data2.guard_id,
							id: this.data2.id,
							rent_type: this.data2.rent_type,
							rent_term: this.data2.rent_term,
							pay_type: this.data2.pay_type,
							have_gas: this.data2.have_gas,
							have_parking: this.data2.have_parking,
							house_bright: this.data2.house_bright,
							ownership: this.data2.ownership,
							decorate: this.data2.decorate,
							water_supply: this.data2.water_supply,
							heating_supply: this.data2.heating_supply,
							power_supply: this.data2.power_supply,
							facilities: this.data2.facilities
						}
						getfinishhouse(data4).then(res => {
							uni.showToast({
								title: res.message,
								icon: "none",
								duration: 1500,
								mask: true
							})
							setTimeout(function() {
								uni.navigateBack({})
							}, 1500)
						})
					} else {
						uni.showToast({
							title: "请将信息填写完整",
							icon: "none",
							duration: 1500
						})
					}
				}
			},
			housesave() {
				let data4 = {}
				if (this.type == "二手房") {
					let a = []
					if (this.data1.imgList.length != 0 && this.data1.imgList2.length != 0) {
						for (let i = 0; i < this.data1.imgList2.length; i++) {
							a.push(this.data1.imgList2[i].url)
						}
						data4 = {
							action: "add", //方式
							type: 1,
							community_id: this.data1.community_id,
							name: this.data1.name,
							price: this.data1.price,
							building_area: this.data1.building_area,
							elevator: this.data1.elevator,
							the_floor: this.data1.the_floor,
							image: this.data1.imgList[0].url, //封面一张
							banner: a.join("|"), //banner图
							serial_number: this.data1.serial_number, //房源编码
							label: this.data1.label,
							remark: this.data1.remark,
							floor: this.data1.floor,
							total_floors: this.data1.total_floors,
							landlord: this.data1.landlord,
							contact: this.data1.contact,
							contact_number: this.data1.contact_number,
							house_type: this.data1.house_type,
							room: this.data1.room,
							hall: this.data1.hall,
							rest_room: this.data1.rest_room,
							orientation: this.data1.orientation,
							see_house: this.data1.see_house,
							description: this.data1.description,
							status: 0, //0=保存    1=发布
							guard_id: this.data1.guard_id,
							id: this.data1.id,
							listed: this.data1.listed,
							house_structure: this.data1.house_structure,
							ladder_house_scale: this.data1.ladder_house_scale,
							house_features: this.data1.house_features,
							build_type: this.data1.build_type,
							purpose: this.data1.purpose,
							unit_price: this.calculate,
							build_date: this.data1.build_date,
							ownerships: this.data1.ownerships,
							house_year: this.data1.house_year
						}
						getfinishhouse(data4).then(res => {
							uni.showToast({
								title: res.message,
								icon: "none",
								duration: 1500,
								mask: true
							})
							setTimeout(function() {
								uni.navigateBack({})
							}, 1500)
							this.$store.state.community_id = ""
							this.$store.state.guard_id = ""
							this.$store.state.name = ""
							this.$store.state.plicname = ""
						})
					} else {
						uni.showToast({
							title: "请将信息填写完整",
							icon: "none",
							duration: 1500
						})
					}
				} else if (this.type == "租房") {
					let a = []
					if (this.data2.imgList3.length != 0 && this.data2.imgList4.length != 0) {
						for (let i = 0; i < this.data2.imgList4.length; i++) {
							a.push(this.data2.imgList4[i].url)
						}
						data4 = {
							action: "add", //方式
							type: 2,
							community_id: this.data2.community_id,
							name: this.data2.name,
							price: this.data2.price,
							building_area: this.data2.building_area,
							elevator: this.data2.elevator,
							the_floor: this.data2.the_floor,
							image: this.data2.imgList3[0].url, //封面一张
							banner: a.join("|"), //banner图
							serial_number: this.data2.serial_number, //房源编码
							label: this.data2.label,
							remark: this.data2.remark,
							floor: this.data2.floor,
							total_floors: this.data2.total_floors,
							landlord: this.data2.landlord,
							contact: this.data2.contact,
							contact_number: this.data2.contact_number,
							house_type: this.data2.house_type,
							room: this.data2.room,
							hall: this.data2.hall,
							rest_room: this.data2.rest_room,
							orientation: this.data2.orientation,
							see_house: this.data2.see_house,
							status: 0, //0=保存    1=发布
							guard_id: this.data2.guard_id,
							id: this.data2.id,
							rent_type: this.data2.rent_type,
							rent_term: this.data2.rent_term,
							pay_type: this.data2.pay_type,
							have_gas: this.data2.have_gas,
							have_parking: this.data2.have_parking,
							house_bright: this.data2.house_bright,
							ownership: this.data2.ownership,
							decorate: this.data2.decorate,
							water_supply: this.data2.water_supply,
							heating_supply: this.data2.heating_supply,
							power_supply: this.data2.power_supply,
							facilities: this.data2.facilities
						}
						getfinishhouse(data4).then(res => {
							uni.showToast({
								title: res.message,
								icon: "none",
								duration: 1500,
								mask: true
							})
							setTimeout(function() {
								uni.navigateBack({})
							}, 1500)
							this.$store.state.community_id = ""
							this.$store.state.guard_id = ""
							this.$store.state.name = ""
							this.$store.state.plicname = ""
						})
					} else {
						uni.showToast({
							title: "请将信息填写完整",
							icon: "none",
							duration: 1500
						})
					}
				}
			},










			allhouseprice(e) {
				this.unit_price = e.detail.value
			},


		},
		onLoad(e) {
			this.$store.state.community_id = ""
			this.$store.state.guard_id = ""
			this.$store.state.name = ""
			this.$store.state.plicname = ""
			if (e.type == 1) {
				this.bool = true
			}
			if (e.type == 2) {
				this.bool = false
			}

			getselect({
				type: 'house_type,elevator,the_floor,decorate,rent_type,rent_term,ownership,orientation,purpose,ownerships,build_type,house_features,house_bright'
			}).then(res => {
				this.elevator = res.data.elevator.child
				this.house_type = res.data.house_type.child
				this.the_floor = res.data.the_floor.child
				this.decorate = res.data.decorate.child
				this.rent_type = res.data.rent_type.child
				this.rent_term = res.data.rent_term.child
				this.ownership = res.data.ownership.child
				this.orientation = res.data.orientation.child
				this.purpose = res.data.purpose.child
				this.ownerships = res.data.ownerships.child
				this.build_type = res.data.build_type.child
				this.house_features = res.data.house_features.child
				this.house_bright = res.data.house_bright.child //房源亮点
			})

			getPtSS().then(res => {
				this.facilities = res.data
			})


			if (this.type == "二手房") {
				getlabel({
					type: 1
				}).then(res => {
					this.data1.biaoqian = res.data.map(v => {
						v.text = v.name
						return v
					})
				})
			} else if (this.type = '租房') {
				getlabel({
					type: 2
				}).then(res => {
					this.data2.biaoqian = res.data.map(v => {
						v.text = v.name
						return v
					})
				})
			}
		},
		onShow() {
			setTimeout(() => {
				this.flag = true
			}, 1000)
			let that = this

			if (this.$store.state.text == "二手房") {
				this.data1.community_id = this.$store.state.community_id
				this.data1.guard_id = this.$store.state.guard_id
				this.data1.housenames = this.$store.state.name
				this.data1.policename1 = this.$store.state.plicname
				this.bool = true
			} else if (this.$store.state.text == "租房") {
				this.data2.community_id = this.$store.state.community_id
				this.data2.guard_id = this.$store.state.guard_id
				this.bool = false
				this.data2.policename2 = this.$store.state.plicname
				this.data2.housenames2 = this.$store.state.name
			}

		},
		computed: {
			startDate() {
				return this.getDate('start');
			},
			endDate() {
				return this.getDate('end');
			},
			calculate() {
				return Math.floor(this.data1.price * 10000 / this.data1.building_area * 100) / 100
			}
		},
	}
</script>

<style scoped>
	page {
		background-color: #FFFFFF;
	}

	.tangchubox {
		width: 500rpx;
		padding: 20rpx;
		box-sizing: border-box;
		height: 400rpx;
	}

	.boxs {
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: #FFFFFF;
	}

	.cu-form-group {
		padding: 0 !important;
		display: flex !important;
		justify-content: space-between !important;
	}

	.top {
		display: flex;
		justify-content: space-between;
		margin-top: 49rpx;
		margin-left: 54rpx;
		margin-right: 100rpx;
	}

	.houseclass {
		color: #676767;
		width: 121rpx;
		height: 52rpx;
		text-align: center;
	}

	.specil {
		border-bottom: 7rpx solid #ce3d3a;
		color: #000000;
		font-weight: 700;
	}

	.hr {
		width: 100%;
		height: 1rpx;
		background-color: #e6e6e6;
	}



	.box {
		padding: 0 31rpx;
		box-sizing: border-box;
	}

	/* 所在小区 */
	.plotbox {
		display: flex;
		justify-content: space-between;
		margin-top: 66rpx;
	}

	.plot {
		font-size: 26rpx;
		font-family: MicrosoftYaHei;
		color: #000000;
	}

	.plotbname {
		font-family: MicrosoftYaHei;
		font-size: 26rpx;
		color: #666666;
		margin-left: 40rpx;
	}

	.hrs>.right {
		width: 15rpx;
		height: 27rpx;
		margin-top: 10rpx;
		display: flex;
	}

	/* 房屋名称 */
	.plotboxs {
		display: flex;
		/* text-align: center; */
		margin-top: 66rpx;
	}

	.hrs {
		border-bottom: 1rpx solid #999999;
		margin-left: 40rpx;
		width: 547rpx;
		display: flex;
		justify-content: space-between;
	}

	.hrs>input {
		width: 547rpx;
	}

	/* 房源价格 */
	.hrss {
		border-bottom: 1rpx solid #999999;
		margin-left: 40rpx;
		width: 469rpx;
	}

	.price {
		font-size: 26rpx;
		color: #282828;
		font-family: MicrosoftYaHei;
	}

	/* 所属楼层 */
	.department {
		font-family: MicrosoftYaHei;
		font-size: 26rpx;
		color: #000000;
	}

	.transverse {
		border-bottom: 1rpx solid #999999;
		margin-left: 40rpx;
		width: 200rpx;
	}

	/* 户型 */
	.transverses {
		border-bottom: 1rpx solid #999999;
		margin-left: 40rpx;
		width: 126rpx;
		display: flex;
		justify-content: space-between;
	}

	.transverses>.style {
		width: 110rpx;
		text-align: center;
	}

	.transverses>.angle {
		width: 0;
		height: 0;
		border-left: 10rpx solid transparent;
		border-right: 10rpx solid transparent;
		border-top: 10rpx solid black;
		margin-top: 20rpx;
	}

	.transverses>.style {
		font-size: 26rpx;
		color: #666666;
	}

	/* 封面上传 */
	.showimg_box {
		display: flex;
		flex-wrap: wrap;
	}

	.add {
		width: 100rpx;
		height: 100rpx;
		margin-left: 20rpx;
		margin-right: 20rpx;
		margin-bottom: 10rpx;
	}

	.adds {
		width: 100rpx;
		height: 100rpx;
		margin-right: 30rpx;
		margin-bottom: 10rpx;
	}


	.imgarr {
		align-items: center;
		position: relative;
	}

	.icon-cuo {
		position: absolute;
		right: 13rpx;
		top: -13rpx;
		z-index: 10009;
		border-radius: 50%;
		width: 36rpx;
		height: 36rpx;
	}

	.left {
		white-space: nowrap;
	}

	.basebtn {
		display: flex;
		justify-content: space-between;
		margin-left: 20rpx;
		margin-right: 20rpx;
	}

	.upload {
		height: 90rpx;
		line-height: 90rpx;
		text-align: center;
		background-color: #fc7b63;
		border-radius: 5rpx;
		color: #FFFFFF;
		font-family: MicrosoftYaHei;
		font-size: 30rpx;
		width: 300rpx;
		margin-top: 82rpx;
		margin-bottom: 28rpx;
	}

	.uploads {
		height: 90rpx;
		line-height: 90rpx;
		text-align: center;
		background-color: #F8B642;
		border-radius: 5rpx;
		color: #FFFFFF;
		font-family: MicrosoftYaHei;
		font-size: 30rpx;
		width: 300rpx;
		margin-top: 82rpx;
		margin-bottom: 28rpx;
	}

	/* 复选框 */
	.cekname {
		width: 90%;
		display: flex;
		flex-wrap: wrap;
	}

	.reason {
		width: 100%;
		text-align: center;
		height: 50rpx;
		background-color: #f75653;
		line-height: 50rpx;
		color: #FFFFFF;
	}

	.show {
		margin-top: -28rpx;
		margin-left: 20rpx;
	}

	/* 户型下拉框 */
	.housetype {
		position: relative;
	}

	.housetype .modelbox {
		position: absolute;
		top: 40rpx;
		left: 116rpx;
		background-color: #007AFF;
		width: 120rpx;
		text-align: center;
		z-index: 9999;
	}

	.modelbox view {
		height: 50rpx;
		line-height: 50rpx;
	}

	textarea {
		border: solid 2rpx #bebebe;
		border-radius: 20rpx;
		padding: 10rpx;
		box-sizing: border-box;
		margin-left: 23rpx;
	}
	.jianzhuyear{
		margin-left: 20rpx;
	}
</style>
